def bucket_sort(array):
    if len(array) < 2:
        return
    medium=(max(array)+min(array))//2
    left=[ n for n in array if n <= medium ]
    right=[ n for n in array if n > medium ]
    bucket_sort(left)
    bucket_sort(right)
    array[:]=left+right

array=[11,9,21,8,17,19,13,1,24,12]
print(array)
bucket_sort(array)
print(array)
